<template>
  <div id="client">
    <p style="margin-left: 20px">
      <span class="demonstration" style="margin-left: 20px">有效日期：</span>
      <el-date-picker
        style="width: 160px"
        v-model="value2"
        type="daterange"
        align="right"
        unlink-panels
        range-separator="至"
        start-placeholder="开始"
        end-placeholder="结束"
        :picker-options="pickerOptions"
      >
      </el-date-picker>
      &nbsp;&nbsp;&nbsp; 单据编号：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="单据编号"
        v-model="input"
        clearable
      >
      </el-input>
      &nbsp;&nbsp;&nbsp; 客户：<el-input
        style="width: 180px; margin-left: 10px; margin-right: 20px"
        placeholder="请输入客户"
        v-model="input"
        clearable
      ></el-input>
      <el-button
        style="margin-left: -20px; margin-right: 10px"
        @click="dialogFormVisible = true"
        >...</el-button
      >
      &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
      <el-button type="primary">查询</el-button>
    </p>
    <p style="margin-top: 30px">
      <span style="display: inline-block; float: left; margin-left: 40px">
        销售人员：<el-input
          style="width: 180px; margin-left: 10px; margin-right: 20px"
          placeholder="请输入客户"
          v-model="input"
          clearable
        ></el-input>
        <el-button
          style="margin-left: -20px; margin-right: 10px"
          @click="dialogFormVisible = true"
          >...</el-button
        >
      </span>
      <span
        style="
          display: inline-block;
          float: right;
          margin-right: 60px;
          margin-bottom: 20px;
        "
      >
        <el-button type="primary">发票登记</el-button>
        <el-button @click="goto('InvoicingList')">开票记录</el-button>
      </span>
    </p>
    <el-table
      height="300px"
      :data="tableData"
      border
      style="width: 100%; font-size: 13px"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="date" label="单据日期" width="150">
      </el-table-column>
      <el-table-column prop="ordersId" label="单据编号" width="120">
      </el-table-column>
      <el-table-column prop="orderId" label="源销货订单号" width="120">
      </el-table-column>
      <el-table-column prop="client" label="客户" width="120">
      </el-table-column>
      <el-table-column prop="totalmoney" label="金额" width="120">
      </el-table-column>
      <el-table-column prop="sellman" label="销售人员" width="120">
      </el-table-column>
      <el-table-column prop="discount" label="优惠后金额" width="120">
      </el-table-column>
      <el-table-column prop="getMoney" label="已收款" width="120">
      </el-table-column>
      <el-table-column prop="piaoMoney" label="已开票金额" width="120">
      </el-table-column>
      <el-table-column prop="nopiaoMoney" label="未开票金额" width="120">
      </el-table-column>
      <el-table-column prop="nowpiaoMoney" label="本次开票金额" width="120">
      </el-table-column>
      <el-table-column prop="tax" label="税率" width="120"> </el-table-column>
      <el-table-column prop="goStatus" label="审核状态" width="120">
      </el-table-column>
      <el-table-column prop="mytext" label="备注" width="120">
      </el-table-column>
    </el-table>
    <div style="width: 100%; background-color: blanchedalmond; height: 30px">
      <table style="width: 78.7%; height: 30px">
        <tr>
          <td style="width: 50%">合计：</td>
          <td style="width: 50%">123</td>
        </tr>
      </table>
    </div>
    <p style="margin-top: 10px; margin-bottom: 10px">
      开票日期：
      <el-date-picker
        v-model="value3"
        type="datetime"
        placeholder="选择日期时间"
        default-time="12:00:00"
      >
      </el-date-picker
      >&nbsp;&nbsp;&nbsp; 发票号：<el-input
        style="width: 200px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
      发票金额：<el-input
        style="width: 200px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
    </p>
    <p style="">
      发票抬头：<el-input
        style="width: 200px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
      开票备注：<el-input
        style="width: 200px; margin-left: 10px; margin-right: 20px"
        v-model="input"
        clearable
      >
      </el-input>
    </p>
    <el-dialog top="20px" title="选择客户" :visible.sync="dialogFormVisible">
      <el-input
        v-model="input"
        placeholder="请输入编号或名称"
        style="width: 200px; margin-left: 20px"
      ></el-input>
      <el-checkbox v-model="checked" style="margin-left: 20px"
        >显示禁用客户</el-checkbox
      >
      <el-button type="success" style="margin-left: 20px">查询</el-button>
      <el-table :data="gridData">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column
          width="100"
          property="name"
          label="类别"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="编号"
        ></el-table-column>
        <el-table-column
          width="300"
          property="address"
          label="名称"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="联系人"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="手机"
        ></el-table-column>
        <el-table-column
          width="100"
          property="address"
          label="备注"
        ></el-table-column>
      </el-table>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>

    <el-dialog top="20px" title="选择商品" :visible.sync="dialogFormVisible1">
      <el-input
        v-model="spid"
        placeholder="请输入编号或名称"
        style="width: 200px; margin-left: 20px"
      ></el-input
      >&nbsp;&nbsp; 仓库：<el-select
        v-model="ckid"
        placeholder="请选择"
        style="width: 100px"
      >
        <el-option
          v-for="item in ck"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
      <el-checkbox v-model="checked" style="margin-left: 20px"
        >显示禁用商品</el-checkbox
      >
      <el-button type="success" style="margin-left: 20px">查询</el-button>
      <el-table :data="gridData1">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column width="100" label="图片"></el-table-column>
        <el-table-column
          width="100"
          property="goodsId"
          label="商品编号"
        ></el-table-column>
        <el-table-column
          width="300"
          property="address"
          label="产地"
        ></el-table-column>
        <el-table-column
          width="100"
          property="property"
          label="辅助属性编号"
        ></el-table-column>
        <el-table-column
          width="100"
          property="name"
          label="商品名称"
        ></el-table-column>
        <el-table-column
          width="100"
          property="model"
          label="规格型号"
        ></el-table-column>
        <el-table-column
          width="100"
          property="type"
          label="商品类别"
        ></el-table-column>
        <el-table-column
          width="100"
          property="danwei"
          label="单位"
        ></el-table-column>
        <el-table-column
          width="100"
          property="kc"
          label="库存"
        ></el-table-column>
        <el-table-column
          width="100"
          property="text"
          label="备注"
        ></el-table-column>
      </el-table>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination layout="prev, pager, next" :total="1000">
        </el-pagination>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible1 = false"
          >确 定</el-button
        >
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "Invoicing",
  data() {
    return {
      gridData1: [
        {
          text: "备注",
          kc: "默认仓库",
          danwei: "个",
          type: "水果",
          model: "规格型号",
          name: "库尔勒香梨",
          address: "产地",
          goodsId: "123",
        },
        {
          text: "备注",
          kc: "默认仓库",
          danwei: "个",
          type: "水果",
          model: "规格型号",
          name: "库尔勒香梨",
          address: "产地",
          goodsId: "123",
        },
        {
          text: "备注",
          kc: "默认仓库",
          danwei: "个",
          type: "水果",
          model: "规格型号",
          name: "库尔勒香梨",
          address: "产地",
          goodsId: "123",
        },
        {
          text: "备注",
          kc: "默认仓库",
          danwei: "个",
          type: "水果",
          model: "规格型号",
          name: "库尔勒香梨",
          address: "产地",
          goodsId: "123",
        },
        {
          text: "备注",
          kc: "默认仓库",
          danwei: "个",
          type: "水果",
          model: "规格型号",
          name: "库尔勒香梨",
          address: "产地",
          goodsId: "123",
        },
        {
          text: "备注",
          kc: "默认仓库",
          danwei: "个",
          type: "水果",
          model: "规格型号",
          name: "库尔勒香梨",
          address: "产地",
          goodsId: "123",
        },
      ],
      dialogFormVisible1: false,
      dialogFormVisible: false,
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      tableData: [
        {
          date: "2024-01-01",
          ordersId: "OD001",
          orderId: "SO001",
          client: "客户A",
          totalmoney: 1000,
          sellman: "销售员A",
          discount: 950,
          getMoney: 700,
          piaoMoney: 600,
          nopiaoMoney: 350,
          nowpiaoMoney: 300,
          tax: "13%",
          goStatus: "待审核",
          mytext: "无特殊要求",
        },
        {
          date: "2024-01-05",
          ordersId: "OD002",
          orderId: "SO002",
          client: "客户B",
          totalmoney: 2000,
          sellman: "销售员B",
          discount: 1900,
          getMoney: 1500,
          piaoMoney: 1800,
          nopiaoMoney: 200,
          nowpiaoMoney: 200,
          tax: "13%",
          goStatus: "已审核",
          mytext: "加急处理",
        },
        {
          date: "2024-01-10",
          ordersId: "OD003",
          orderId: "SO003",
          client: "客户C",
          totalmoney: 1500,
          sellman: "销售员C",
          discount: 1400,
          getMoney: 1000,
          piaoMoney: 1200,
          nopiaoMoney: 300,
          nowpiaoMoney: 300,
          tax: "13%",
          goStatus: "审核中",
          mytext: "需提供发票",
        },
        {
          date: "2024-01-15",
          ordersId: "OD004",
          orderId: "SO004",
          client: "客户D",
          totalmoney: 2200,
          sellman: "销售员D",
          discount: 2100,
          getMoney: 1800,
          piaoMoney: 2000,
          nopiaoMoney: 200,
          nowpiaoMoney: 200,
          tax: "13%",
          goStatus: "待审核",
          mytext: "节假日顺延",
        },
      ],
      dialogFormVisible: false,
      gridData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
      ],
      value2: "",
    };
  },
  methods: {
    goto(to) {
      if (this.$route.path !== "/" + to) {
        this.$router.push(to);
      }
    },
  },
};
</script>

<style scoped>
.el-button el-button--default el-popover__reference {
  margin-right: 20px;
}

tr {
  border: 1px solid black;
}
</style>